package com.yakumosakura.yakumoblade.registry;

import com.yakumosakura.yakumoblade.item.StarSoulCrystal;
import com.yakumosakura.yakumoblade.item.StarTreasureScripture;
import net.minecraft.world.item.Item;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;

import java.util.function.Supplier;

import static com.yakumosakura.yakumoblade.Yakumoblade.MODID;
import static com.yakumosakura.yakumoblade.registry.creativetab.ItemTab.YAKUMOTAB;


public class ItemRegistry {
    private static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MODID);
    public static final RegistryObject<Item> UMLE = regmaker("umle");
    public static final RegistryObject<Item> Star_Soul_Crystal = regmaker("star_soul_crystal",
            StarSoulCrystal::new);
    public static final RegistryObject<Item> StarTreasurescripture = regmaker("star_treasure_scripture",
            StarTreasureScripture::new);
    public static final RegistryObject<Item> powercore = regmaker("powercore");
    public static final RegistryObject<Item> powercoreex = regmaker("powercoreex");
    public static final RegistryObject<Item> ghost_ingot = regmaker("ghost_ingot");
    public static final RegistryObject<Item> red_eyes = regmaker("red_eyes");
    public static final RegistryObject<Item> beyond_flower = regmaker("beyond_flower");//地狱彼岸花
    public static final RegistryObject<Item> legend_od_the_star=regmaker("legend_od_the_star");//星之传说
    public static final RegistryObject<Item> ungod_s_crown=regmaker("ungod_s_crown");//未成的神格
    public static final RegistryObject<Item> red_iron_ingot=regmaker("red_iron_ingot");//泛红的铁锭
    public static final RegistryObject<Item> ark_metal_ingot=regmaker("ark_metal_ingot");//炼狱钢锭
    public static final RegistryObject<Item> blaze_umle = regmaker("blaze_umle");//烈焰锻造模板
    public static final RegistryObject<Item> the_god_s_soul=regmaker("the_god_s_soul");//神录魂
    public static final RegistryObject<Item> blood_sakura=regmaker("blood_sakura");//血樱
    public static final RegistryObject<Item> westward_youkai_wood=regmaker("westward_youkai_wood");//西行妖树枝
    public static final RegistryObject<Item> metal_ingot=regmaker("metal_ingot");//钢锭





    public static void register(IEventBus e){
       ITEMS.register(e);
    }



    public static RegistryObject<Item> regmaker(String name){
        return ITEMS.register(name,() -> new Item(new Item.Properties().stacksTo(555)));
    }
    public static RegistryObject<Item> regmaker(String name, Supplier<? extends Item> sup){
        return ITEMS.register(name,sup);
    }
}
